const { regeneratorRuntime } = global

Page(global.connect(
  state => ({
    ...state.globalReducer
  }),
  dispatch => ({
    handleRoute: global.handleRoute,
    handleLicon1Tap(e) {
      console.log('handleLicon1Tap', e)
      wx.navigateBack()
    },
    async handleSubmit(e) {
      console.log('handleSubmit', e.detail.value)
      const actionRes = await dispatch(global.profileReducer.updatePassword({
        ...e.detail.value,
        id: this.data.minaLoginRes.data.user_id
      }))
      console.log(actionRes)
      if (actionRes.actionStatus === 'SUCCESS') {
        this.selectComponent('#toast').handleShow({
          type: 'success',
          message: actionRes.apiMes
        })
        setTimeout(() => {
          wx.navigateBack()
        }, 1000);
      } else {
        this.selectComponent('#toast').handleShow({
          message: actionRes.apiMes
        })
      }
    }
  })
)({
  onLoad(options) {
    console.log('Modpwd onLoad')
  },
}))
